﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Unity {
    public abstract class ModuleBase {
        private IXContainer _container;

        public IXContainer Container {
            get {
                return _container;
            }
        }

        private CommandManager _cmdMgr;

        public CommandManager CmdMgr {
            get {
                return _cmdMgr;
            }
        }

        public ModuleBase(CommandManager cmdMgr, IXContainer container) {
            _cmdMgr = cmdMgr;
            _container = container;
        }

        public virtual void Initialize() {
        }

        public virtual void Regist<I>(I instance) where I : class {
            _container.Register<I>(instance);
        }
          
        public virtual void CreateService() {

        }

        public virtual void CreateCommands() {
            _cmdMgr.CreateCommands(_container);
        }
    }
}
